import 'package:flutter/material.dart';
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';

class NewDetail extends StatefulWidget {
  String url;
  String title;

  NewDetail({this.url, this.title});

  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return DetailWidget();
  }
}

class DetailWidget extends State<NewDetail> {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    print(widget.url);
    if (widget.url == null || widget.url.isEmpty) {
      return Container(
        child: Text("加载失败"),
      );
    }
    return WebviewScaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      url: widget.url,
      withJavascript: false,
      clearCookies: true,
      clearCache: true,
      withZoom: true,
      withLocalUrl: true,
      withLocalStorage: false,
      scrollBar: false,
    );
  }
}
